 package server.achievement;

 import client.MapleCharacter;
 import handling.world.WorldBroadcastService;
 import tools.MaplePacketCreator;




 public class MapleAchievement
 {
   private final boolean notice;
   private String name;
/*  14 */   private int cashReward = 0;
/*  15 */   private int expReward = 0;
/*  16 */   private int mesoReward = 0;
/*  17 */   private int itemReward = 0;

   public MapleAchievement(String name, int cash, int exp, int meso) {
/*  20 */     this.name = name;
/*  21 */     this.cashReward = cash;
/*  22 */     this.expReward = exp;
/*  23 */     this.mesoReward = meso;
/*  24 */     this.notice = true;
   }

   public MapleAchievement(String name, int cash, int exp, int meso, boolean notice) {
/*  28 */     this.name = name;
/*  29 */     this.cashReward = cash;
/*  30 */     this.expReward = exp;
/*  31 */     this.mesoReward = meso;
/*  32 */     this.notice = notice;
   }




   public String getName() {
/*  39 */     return this.name;
   }

   public void setName(String name) {
/*  43 */     this.name = name;
   }




   public int getCashReward() {
/*  50 */     return this.cashReward;
   }

   public void setCashReward(int cash) {
/*  54 */     this.cashReward = cash;
   }




   public int getExpReward() {
/*  61 */     return this.expReward;
   }

   public void setExpReward(int exp) {
/*  65 */     this.expReward = exp;
   }




   public int getMesoReward() {
/*  72 */     return this.mesoReward;
   }

   public void setMesoReward(int meso) {
/*  76 */     this.mesoReward = meso;
   }




   public int getItemReward() {
/*  83 */     return this.itemReward;
   }

   public void setItemReward(int itemId) {
/*  87 */     this.itemReward = itemId;
   }




   public boolean getNotice() {
/*  94 */     return this.notice;
   }




   public void finishAchievement(MapleCharacter chr) {
/* 101 */     String message = " 获得 ";
/* 102 */     if (getCashReward() > 0) {
/* 103 */       message = message + this.cashReward + " 点抵用卷 ";
/* 104 */       chr.modifyCSPoints(2, this.cashReward, true);
     }
/* 106 */     if (getExpReward() > 0) {
/* 107 */       message = message + this.expReward + " 点经验 ";
/* 108 */       chr.gainExp(this.expReward, true, true, true);
     }
/* 110 */     if (getMesoReward() > 0) {
/* 111 */       message = message + this.mesoReward + " 金币.";
/* 112 */       chr.gainMeso(this.mesoReward, true, true);
     }
/* 114 */     chr.setAchievementFinished(MapleAchievements.getInstance().getByMapleAchievement(this).intValue());
/* 115 */     if (this.notice && !chr.isIntern()) {
/* 116 */       WorldBroadcastService.getInstance().broadcastMessage(MaplePacketCreator.serverNotice(6, "[成就系统] 祝贺 " + chr.getLevel() + "级 玩家: " + chr.getName() + " " + this.name + message));
     } else {
/* 118 */       chr.send(MaplePacketCreator.serverNotice(5, "[成就系统] 您因为 " + this.name + message));
     }
   }
 }


/* Location:              C:\PGX\Server.jar!\server\achievement\MapleAchievement.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */